package com.chenjinyan.back.vo;

import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author chenjinyan
 * @version 1.0
 */
@Data
public class LoginUser implements Serializable {

    private static final long serialVersionUID = 8172210793368327271L;
    @NotNull(message = "登陆账号不能为空")
    @Size(min = 4, max = 20, message = "密码由4-20位字符组成")
    @Pattern(regexp = "^([a-zA-Z]*[0-9_-]*$)", message = "只能包含字母、数字、下划线，且不能以数字或下划线开头")
    private String username;

    @NotNull(message = "密码不能为空")
    @Size(min = 6, max = 50, message = "密码最少6位字符")
    @Pattern(regexp = "^([a-zA-Z]*[0-9_-]*$)", message = "只能包含字母、数字、下划线，且不能以数字或下划线开头")
    private String password;

}
